package org.gzc.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class IndexController {
	@RequestMapping("/")
	public String home() {
		return "index";
	}

	/**
	 * 跳转用户登录界面
	 *
	 * @param email
	 * @param model
	 * @return
	 */
	@RequestMapping("/user/login")
	public String toLogin(String email, Model model) {
		model.addAttribute("email", email);
		return "login";
	}

	/**
	 * 跳转用户注册界面
	 *
	 * @return
	 */
	@RequestMapping("/user/register")
	public String toRegister() {
		return "register";
	}

	/**
	 * 跳转后台管理页面
	 *
	 * @return
	 */
	@RequestMapping(value = {"/admin"})
	public String index() {
		return "admin/index";
	}

	/**
	 * 用户管理页面
	 *
	 * @return
	 */
	@RequestMapping("/admin/user")
	public String toUserList() {
		return "admin/user";
	}

	@RequestMapping("/test")
	public String test() {
		return "form/userForm";
	}
}
